<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>绝对定位</title>
    <style>
        body {
            background-color: #ddd;
        }
        .container {
            width: 500px;
            height: 500px;
            background-color: white;
            border: 1px solid black;
            margin: 0 auto;
            position: relative;
        }

        .dialog {
            /* 绝对定位的垂直水平居中 */
            margin: auto;
            padding: 30px;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;

            width: 300px;
            height: 200px;
            background-color: white;
            border: 2px solid black;
            border-radius: 30px;
        }

    </style>
</head>
<body>
<!-- 绝对定位: 脱离文档流, 独立的布局上下文, 提升元素层级 -->
<div class="container">
    <div class="dialog">
    </div>
</div>
</body>
</html>